home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d12
/
cbibcode.arc
/
TAN.C
< prev
next >
Wrap
Text File
|
1991-08-05
|
415b
|
23 lines
/* tan.c from page 249*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define R_TO_D 57.29578 /*radians to degrees */
main(int argc, char **argv)
{
double result;
if(argc < 2)
{
printf("usage: %s <degree>\n", argv[0]);
}
else
{
result = tan(atof(argv[1]) / R_TO_D);
if(errno != ERANGE)
{
printf("tangent(%s deg.) = %f\n",
argv[1], result);
}
}
}